<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="keyinfoList" title="信息"
			actionUrl="keyinfoController.do?datagrid&sfsg=1&qyid=${qyid}" idField="id" fit="true"
			sortName="eventdate" sortOrder="desc" queryMode="group">
			<t:dgCol title="编号" field="id" hidden="false"></t:dgCol>
			<t:dgCol title="标题" field="title" width="200" query="true"></t:dgCol>
			<t:dgCol title="关键字" field="keyword" width="100" query="true"></t:dgCol>
			<t:dgCol title="采集站点" field="site" width="100"></t:dgCol>
			<t:dgCol title="类型" field="type" width="100" dictionary="nmstype"></t:dgCol>
			<t:dgCol title="省份" field="sf" width="100"></t:dgCol>
			<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
			<t:dgDelOpt title="删除" url="keyinfoController.do?del&id={id}" />
			<t:dgToolBar title="录入" icon="icon-add"
				url="keyinfoController.do?addorupdate&qyid=${qyid}" funname="addKeyInfo" width="800"></t:dgToolBar>
			<t:dgToolBar title="编辑" icon="icon-edit"
				url="keyinfoController.do?addorupdate&qyid=${qyid}" funname="updateInfo" width="800"></t:dgToolBar>
		</t:datagrid>
	</div>
</div>
<script type="text/javascript">

	function addKeyInfo(title,addurl,gname,width) {
		W.$.dialog({
			content: 'url:'+addurl,
			lock : true,
			title:title,
			opacity : 0.3,
			cache:false,
			parent:windowapi,
			width:800,
			height:500,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
				saveObj();
				setTimeout(function(){
					keyinfoListsearch();
				},500);	
				return false;
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
	}
	
	function updateInfo(title,url,id,width) {
		var rowData = $('#'+id).datagrid('getSelected');
		//update-begin--Author:tanghong  Date:20130504 for：#17 有的时候，明细行明选择，点击编辑却提示未选中行
		if (!rowData) {
			tip('请选择编辑项目');
			return;
		}
		//update-end--Author:tanghong  Date:20130504 for：#17 有的时候，明细行明选择，点击编辑却提示未选中行
		url += '&id='+rowData.id;
		W.$.dialog({
			content: 'url:'+url,
			lock : true,
			title:title,
			opacity : 0.3,
			cache:false,
			parent:windowapi,
			width:800,
			height:500,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
				saveObj();
				setTimeout(function(){
					keyinfoListsearch();//要执行的代码    
				},500);	
				return false;
		    },
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
	}
	
	
</script>